const Controller = require('egg').Controller;

class BgimgController extends Controller {
  async getBgimg() {
    const { ctx } = this;
    let bgimg = await ctx.service.bgimg.getBgimg()
    if(bgimg) {
      ctx.body = {
        code: 20000,
        data: bgimg
      }
    }else{
      ctx.body = {
        code: 50000,
        data: "服务器异常"
      }
    }
  }
}

module.exports = BgimgController;